package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了。。。");

        FileOutputStream fos = null;
        try{
            fos = new FileOutputStream("abc.txt");
        }catch(Exception e){
            System.out.println("异常解决了！");
        }finally{
            try {
                fos.close();
            } catch (IOException e) {
                System.out.println("close解决了");
            }
            System.out.println("finally开始执行了");
        }

        System.out.println("程序结束了。。。");
    }
}
